# CC=gcc
CC=arm-linux-gcc
AFLAGS=-Wall -g -static
LDFLAGS= -L ./lib
OBJS= capture.cgi a9_beep.cgi zigbee_fan.cgi\
	  a9_led.cgi a9_seg.cgi \
	  env1.cgi setEnv.cgi set_sms.cgi

run:$(OBJS) login

$(OBJS):%.cgi:%.c
	$(CC) $(AFLAGS) $< cgic.c data_global.c -o $@ $(LDFLAGS)
#	$(CC) $(AFLAGS) $< cgic.c -o $@ $(LDFLAGS)

login:
	$(CC) $(AFLAGS) login.c -o login.cgi
	
install:
	mv *.cgi ./out/
	sudo cp  ./out/*.cgi  ~/fs4412/sync/rootfs/boa/cgi-bin
	sudo cp  ./out/*.cgi  ../boaServer/boa/cgi-bin
#	sudo cp  ./out/*.cgi  /boa/cgi-bin

.PHONY:clean
clean:
	rm ./out/*.cgi ./*.cgi

